<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table{
            border-collapse: collapse;
        }
    </style>
</head>
<body>
<table border="1">
    <caption>学生信息表</caption>
    <tr><th>ID</th><th>学号</th><th>姓名</th><th>性别</th><th>生日</th><th>国籍</th><th>爱好</th></tr>
    <tr th:each="stu:${students}">
        <td th:text="${stu.id}">1</td>
        <td th:text="${stu.stuno}">1001</td>
        <td th:text="${stu.name}">aaa</td>
        <td th:switch="${stu.sex}">
            <span th:case="0">女</span>
            <span th:case="1">男</span>
        </td>
        <td th:text="${#dates.format(stu.birth,'yyyy-MM-dd')}">1999-12-12</td>
        <td th:switch="${stu.country}">
            <span th:case="0">中国</span>
            <span th:case="1">美国</span>
            <span th:case="2">德国</span>
        </td>
        <td>
            <span th:if="${stu.hobby.contains('music')}">音乐</span>
            <span th:if="${stu.hobby.contains('sport')}">运动</span>
            <span th:if="${stu.hobby.contains('java')}">Java</span>
        </td>

    </tr>
</table>
</body>
</html>